﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="List.ascx.cs" Inherits="Modules_Category_List" %>
<%@ Register TagPrefix="rad" Namespace="Telerik.WebControls" Assembly="RadTreeView.NET2" %>
<%@ Register TagPrefix="rada" Namespace="Telerik.WebControls" Assembly="RadAjax.NET2" %>
<%@ Register TagPrefix="radm" Namespace="Telerik.WebControls" Assembly="RadMenu.NET2" %>

<script type="text/javascript">
    /*<![CDATA[*/
    function treeNodeDropped(sourceNode, destNode) {
        if ((sourceNode) && (destNode)) {
            window["<%= RadAjaxManager1.ClientID %>"].AjaxRequest(sourceNode.TreeView.ClientID + "\r\n" + destNode.TreeView.ClientID + "\r\n" + sourceNode.Text + "\r\n" + destNode.Text);
                    return false;
                }
            }
            /*]]>*/
            //<!--
            function ShowRadMenu(node, e) {
                var menu = window["<%= RadMenu1.ClientID %>"];
                    if (menu) {
                        menu.Show(e);
                        e.cancelBubble = true;
                        if (e.stopPropagation) {
                            e.stopPropagation();
                        }
                        e.returnValue = false;
                        if (e.preventDefault) {
                            e.preventDefault();
                        }
                    }
                }
                //-->                 
</script>


<rad:RadTreeView ID="tree1" runat="server" Width="100%" Height="100%"
    DragAndDrop="True" BeforeClientDrop="treeNodeDropped"
    BeforeClientContextMenu="ShowRadMenu"
    CausesValidation="True" RadControlsDir="~/cms_client/RadControls/">
</rad:RadTreeView>

<radm:RadMenu ID="RadMenu1" runat="server" IsContext="True" Skin="Outlook"
    ContextMenuElementID="none" OnItemClick="RadMenu1_ItemClick" RadControlsDir="~/cms_client/RadControls/">
    <Items>
        <radm:RadMenuItem Value="Edit" Text="Sửa" runat="server" />
        <radm:RadMenuItem Value="EditListPage" Text="Sửa giao diện chính" runat="server" />
        <radm:RadMenuItem Value="EditDetailPage" Text="Sửa giao diện Chi tiết" runat="server" />
        <radm:RadMenuItem Value="Add" Text="Thêm mới" runat="server" />
        <radm:RadMenuItem IsSeparator="true" runat="server" />
        <radm:RadMenuItem Value="Delete" Text="Xóa" runat="server" />
    </Items>
</radm:RadMenu>


<rada:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="AjaxManager1_AjaxRequest" DefaultLoadingPanelID="LoadingPanel1">
    <AjaxSettings>
        <rada:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <rada:AjaxUpdatedControl ControlID="tree1"></rada:AjaxUpdatedControl>
                <rada:AjaxUpdatedControl ControlID="RadMenu1"></rada:AjaxUpdatedControl>
            </UpdatedControls>
        </rada:AjaxSetting>

        <rada:AjaxSetting AjaxControlID="RadMenu1">
            <UpdatedControls>
                <rada:AjaxUpdatedControl ControlID="tree1"></rada:AjaxUpdatedControl>
            </UpdatedControls>
        </rada:AjaxSetting>
    </AjaxSettings>
</rada:RadAjaxManager>
<rada:AjaxLoadingPanel ID="LoadingPanel1" runat="server" Transparency="30" BackColor="#E0E0E0">
    loading..
</rada:AjaxLoadingPanel>
